package gu.common;

public final class Arrays {

	private static int i, l;
	
	public final static int[] copyOf(int[] a, int len) {
		int[] na = new int[len];
		for(i=0;i<len;i++)
			na[i] = a[i];
		return na;
	}

	public final static short[] copyOf(short[] a, int len) {
		short[] na = new short[len];
		for(i=0;i<len;i++)
			na[i] = a[i];
		return na;

	}

	public final static String toString(int[] a) {
		String s = "";
		for(i=0;i<a.length;i++) {
			s = s + a[i] + ", ";
		}
		return "[" + s.substring(0, s.length() - 2) + "]";
	}

	public final static String toString(short[] a) {
		String s = "";
		for(i=0;i<a.length;i++) {
			s = s + a[i] + ", ";
		}
		return "[" + s.substring(0, s.length() - 2) + "]";
	}
	
	public final static void fill(int[] a, int val) {
		l = a.length;
		for(i=0;i<l;i++)
			a[i] = val;
	}
}
